package org.isystem.autpart.beans;
// Generated 15-jun-2013 0:24:19 by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TPersona generated by hbm2java
 */
@Entity
@Table(name="T_PERSONA"
    ,catalog="db_autpart"
)
public class TPersona  implements java.io.Serializable {


     private String id;
     private TPersonaJuridica TPersonaJuridica;
     private TPersonaNatural TPersonaNatural;
     private String email;
     private String direccion;
     private String telefono;
     private Set TEmpleados = new HashSet(0);

    public TPersona() {
    }

	
    public TPersona(String id) {
        this.id = id;
    }
    public TPersona(String id, TPersonaJuridica TPersonaJuridica, TPersonaNatural TPersonaNatural, String email, String direccion, String telefono, Set TEmpleados) {
       this.id = id;
       this.TPersonaJuridica = TPersonaJuridica;
       this.TPersonaNatural = TPersonaNatural;
       this.email = email;
       this.direccion = direccion;
       this.telefono = telefono;
       this.TEmpleados = TEmpleados;
    }
   
     @Id 
    
    @Column(name="ID", unique=true, nullable=false, length=20)
    public String getId() {
        return this.id;
    }
    
    public void setId(String id) {
        this.id = id;
    }
@ManyToOne(fetch=FetchType.LAZY, cascade = CascadeType.ALL)
    @JoinColumn(name="ID_PERSONA_JURIDICA")
    public TPersonaJuridica getTPersonaJuridica() {
        return this.TPersonaJuridica;
    }
    
    public void setTPersonaJuridica(TPersonaJuridica TPersonaJuridica) {
        this.TPersonaJuridica = TPersonaJuridica;
    }
@ManyToOne(fetch=FetchType.LAZY, cascade = CascadeType.ALL)
    @JoinColumn(name="ID_PERSONA_NATURAL")
    public TPersonaNatural getTPersonaNatural() {
        return this.TPersonaNatural;
    }
    
    public void setTPersonaNatural(TPersonaNatural TPersonaNatural) {
        this.TPersonaNatural = TPersonaNatural;
    }
    
    @Column(name="EMAIL", length=50)
    public String getEmail() {
        return this.email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
    
    @Column(name="DIRECCION", length=100)
    public String getDireccion() {
        return this.direccion;
    }
    
    public void setDireccion(String direccion) {
        this.direccion = direccion;
    }
    
    @Column(name="TELEFONO", length=20)
    public String getTelefono() {
        return this.telefono;
    }
    
    public void setTelefono(String telefono) {
        this.telefono = telefono;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="TPersona")
    public Set getTEmpleados() {
        return this.TEmpleados;
    }
    
    public void setTEmpleados(Set TEmpleados) {
        this.TEmpleados = TEmpleados;
    }




}


